<?php
namespace backend\controllers;

use common\components\BaseController;
use SebastianBergmann\CodeCoverage\Report\Xml\Project;
use Yii;
use yii\db\Query;
use \common\helps\tools;
use \common\helps\code;

/**
 * User controller
 */
class ToolsController extends BaseController
{

    public $modelClass = 'backend\models\LoginLog';

    /*
     * 登录日志列表
     * @param Request $request
     * @author cpy(1442435897@qq.com)
     * @return Json
     */
    public function actionLoginLogList()
    {
        $model = new \backend\models\LoginLog();
        $request =$this->request;
        $params = $request->queryParams;
        $total = $model::selectData($params);
        $res = tools::getPageData($total,empty($params['page_size'])?'':$params['page_size'],empty($params['page'])?'':$params['page']);
        return code::success($res);
    }

    /*
     * 操作日志列表
     * @param Request $request
     * @author cpy(1442435897@qq.com)
     * @return Json
     */
    public function actionLogActionList()
    {
        $model = new \backend\models\ActionLog();
        $request =$this->request;
        $params = $request->queryParams;
        $total = $model::selectData($params);
        $res = tools::getPageData($total,empty($params['page_size'])?'':$params['page_size'],empty($params['page'])?'':$params['page']);
        return code::success($res);
    }


}
